Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DevOps to cache conda and fix attributes not being preserved with xarray > 2023.3.0 #465

Merged
merged 7 commits into from
May 11, 2023

Conversation

tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Apr 26, 2023

Description

build_workflow.yml

ci.yml

  • Constrain xesmf >0.6.3 to avoid import error with esmpy

_logger.py

  • Update logger module to make it private and fix propagation by configuring single root handler at the module level

bounds.py, dataset.py, regridder/base.py

  • Update references to private logger module
  • Update test to silence logger warnings which were polluting the test suite

temporal.py

tests/test_*.py

  • Clean up tests to reduce length by subsetting coordinates in generated datasets
  • Organize sections in tests with comments
  • Silence logger warnings to clean up output

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

@github-actions github-actions bot added the type: devops Testing, CI/CD, systems configuration label Apr 26, 2023
@tomvothecoder tomvothecoder changed the title Update build workflow to cache conda env correctly [DevOps]: Update build workflow to cache conda env correctly Apr 27, 2023
- Update `_logger.py` module to avoid propagating logger messages multiple times
- Update `TemporalAccessor._set_data_var_attrs` try and except statement to a `.get()`
@tomvothecoder tomvothecoder changed the title [DevOps]: Update build workflow to cache conda env correctly Update DevOps to cache conda and fix attributes not being preserved with xarray > 2023.3.0 May 11, 2023
@tomvothecoder tomvothecoder added the type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label May 11, 2023
@@ -1138,7 +1138,7 @@ def _group_average(
# dimension) shape of the `weights` DataArray to the
# multi-dimensional shape of its corresponding data variable.
weights, _ = xr.broadcast(self._weights, dv)
weights = xr.where(np.isnan(dv), 0.0, weights)
weights = xr.where(dv.copy().isnull(), 0.0, weights)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line resolves #458. In the latest version of xarray, xr.where() with np.isnan(dv) deletes the attributes on dv. The fix is to replace np.isnan(dv) with dv.copy().isnull(). Not exactly sure what changed in xarray.

tests/test_dataset.py Outdated Show resolved Hide resolved
@tomvothecoder tomvothecoder marked this pull request as ready for review May 11, 2023 00:08
@tomvothecoder tomvothecoder self-assigned this May 11, 2023
- Bump xarray to latest version in conda envs
@tomvothecoder tomvothecoder merged commit b896c8a into main May 11, 2023
@tomvothecoder tomvothecoder deleted the devops/464-conda-cache branch May 11, 2023 19:10
@tomvothecoder tomvothecoder changed the title Update DevOps to cache conda and fix attributes not being preserved with xarray > 2023.3.0 Update DevOps to cache conda and fix attributes not being preserved with xarray >= 2023.4.2 Aug 17, 2023
@tomvothecoder tomvothecoder changed the title Update DevOps to cache conda and fix attributes not being preserved with xarray >= 2023.4.2 Update DevOps to cache conda and fix attributes not being preserved with xarray > 2023.3.0 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors. type: devops Testing, CI/CD, systems configuration
Projects
None yet
1 participant